package SocialMediaSentiment;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;


public class createWoordenlijsten {
	private static int ONTKENNING = 3;
	private static int VERSTERKING = 5;
	private static int POSITIEF = 7;
	private static int NEGATIEF = 9;

	public static void main(String[] args) throws IOException
	{
		HashMap<String, List<String>> shizzle = getWoordenlijsten();
		Iterator<String> k = (Iterator<String>) shizzle.keySet().iterator();
		while(k.hasNext())
		{
			String type = k.next();
			System.out.println("---------------------------------------"+type);
			List<String> words = shizzle.get(type);
			for( String word : words)
			{
				System.out.println(word);
			}
		}
	}
	public static HashMap<String, List<String>> getWoordenlijsten() throws IOException	{
		HashMap<String, List<String>> woordenlijsten = new HashMap<String, List<String>>();
		List<String> ontkenningWords = createList(ONTKENNING);
		List<String> versterkingWords = createList(VERSTERKING);
		List<String> positiefWords = createList(POSITIEF);
		List<String> negatiefWords = createList(NEGATIEF);
		woordenlijsten.put("ontkenning", ontkenningWords);
		woordenlijsten.put("versterking", versterkingWords);
		woordenlijsten.put("positief", positiefWords);
		woordenlijsten.put("negatief", negatiefWords);
		return woordenlijsten;
		
	}
	public static List<String> createList(int column) throws IOException
	{
		//Vector<String> words = new Vector<String>();
		List<String> words = new ArrayList<String>();
		HashMap<Integer, String[]> wordsMap = ReadExcel.read("woordenlijst.xls", 0, column);
		Iterator<Integer> k = (Iterator<Integer>) wordsMap.keySet().iterator();
		while(k.hasNext())
		{
			int index = k.next();
			String[] wordFlag = wordsMap.get(index);
			if(wordFlag[1].equals("x"))
			{
				words.add(wordFlag[0]);
			}
		}
		return words;
	}
}
